﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Ionic.Zip;

namespace Ex3.ZipUnzipBin._3rdParty
{
    class ZipUnzipBin
    {
        public static void Zip(string fileName)
        {
            ZipFile zipFile = new ZipFile();
            zipFile.AddFile(fileName);
            zipFile.Save("asd.zip");
        }

        public static void Unzip(string fileName)
        {
            ZipFile zipFile = ZipFile.Read(fileName);
            foreach (ZipEntry file in zipFile.Entries)
            {
                file.Extract();
            }
        }

        static void Main(string[] args)
        {
            string fileName = "asd.bin";
            Zip(fileName);
            File.Delete("asd.bin");
            Unzip("asd.zip");
        }
    }
}
